package Entity;

import java.awt.List;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;

import javax.persistence.Basic;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;


@Entity
@Table(schema="poleinfodb", name = "society")
public class Society implements Serializable {
	private static final long serialVersionUID = 42L;
	
	
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO) 
	private int id_Society;
	
	@Basic(optional=false)
	private String name;
	
	@Basic(optional=false)
	private String activitySector;
	
	@Basic(optional=false)
	private int shareQuantity;
	
	@Basic(optional=false)
	private double sharePrice;
	
	@Transient
	private SocietyMember societyMember;
	
	@Transient
	private Collection<Contract> contracts;
	

	public Society(){
		
	}
	public Society(int id_Society, String name, String activitySector,
			int shareQuantity, double sharePrice, SocietyMember societyMember) {
		super();
		this.id_Society = id_Society;
		this.name = name;
		this.activitySector = activitySector;
		this.shareQuantity = shareQuantity;
		this.sharePrice = sharePrice;
		this.societyMember = societyMember;
		this.contracts = new ArrayList<Contract>();
	}
	
	

	public Society(String name, String activitySector, int shareQuantity,
			double sharePrice, SocietyMember societyMember) {
		super();
		this.name = name;
		this.activitySector = activitySector;
		this.shareQuantity = shareQuantity;
		this.sharePrice = sharePrice;
		this.societyMember = societyMember;
		this.contracts = new ArrayList<Contract>();
	}



	public Collection<Contract> getContracts() {
		return contracts;
	}

	@Override
	public String toString() {
		return "Society [id_Society=" + id_Society + ", name=" + name
				+ ", activitySector=" + activitySector + ", shareQuantity=" + shareQuantity + ", sharePrice="
				+ sharePrice + ", societyMember=" + societyMember + "]";
	}

	public int getId_Society() {
		return id_Society;
	}

	public void setId_Society(int id_Society) {
		this.id_Society = id_Society;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getActivitySector() {
		return activitySector;
	}

	public void setActivitySector(String activitySector) {
		this.activitySector = activitySector;
	}

	public int getShareQuantity() {
		return shareQuantity;
	}

	public void setShareQuantity(int shareQuantity) {
		this.shareQuantity = shareQuantity;
	}

	public double getSharePrice() {
		return sharePrice;
	}

	public void setSharePrice(double sharePrice) {
		this.sharePrice = sharePrice;
	}

	public SocietyMember getSocietyMember() {
		return societyMember;
	}

	public void setSocietyMember(SocietyMember societyMember) {
		this.societyMember = societyMember;
	}
}
